<template>
  <div class="header-container">
    <div class="el-header">
      <el-button
        @click="changeMenu"
        class="menu"
        icon="el-icon-menu"
        circle
        style="margin-top: 11px; margin-right: 20px"
      ></el-button>
      <el-breadcrumb separator="/" style="line-height:60px;">
        <el-breadcrumb-item v-for="item in tabsList" :key="item.path" :to="{ path: item.path} "><a style="color: #fff;">{{item.label}}</a></el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="user">
      <el-dropdown>
        <span class="el-dropdown-link">
          <img src="../assets/images/user.png" alt=""  title="用户" />
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人中心</el-dropdown-item>
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "commonHeader",
  methods: {
    changeMenu() {
      this.$store.commit("collapseMenu");
    },
  },
  computed: {
    ...mapState({
      tabsList: (state) => state.tab.tabsList,
    }),
  },
};
</script>

<style lang="less">
.header-container {
  display: flex;
  justify-content: space-between;
  height: 60px;
  line-height: 60px;
  background: #2f3235;

  .el-header {
    display: flex;
    padding: 0 20px;
    line-height: 60px;

    .el-icon-arrow-right {
      display: flex;
    }
    .menu {
      line-height: 12px;
      border-radius: 5px;
      height: 38px;
      width: 40px;
    }

    .crumbs {
      margin-left: 10px;
      font-size: 14px;
      color: #fff;
    }
  }

  .user {
    color: #fff;
    height: 60px;
    padding: 13px 15px;
    line-height: 10px;
    img {
      width: 33px;
      height: 33px;
      border-radius: 25px;
    }
  }
}
</style>